<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jquery</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>

<body>
 <div id="app">12</div>
</body>
<script>
    let date = new Date()
    let strDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
    console.log(strDate)
    // let url = 'https://apiv3.shanbay.com/weapps/dailyquote/quote/?data=' + strDate
    // let url = 'http://jsonplaceholder.typicode.com/todos'
    // // https://web.shanbay.com/op/quotes/2020-03-03/
    // // let xmlhttp = new XMLHttpRequest()
    // $.ajax({
    //     url: url,
    //     type: 'get',
    //     // beforeSend: function(xhr) {
    //     //     xhr.setRequestHeader("organId:'1333333333'");
    //     // },
    //     headers: {'Access-Token': 'date'}
    // }).then(res => {
    //     console.log(res)
    //     // let app = document.getElementById('app')
    //     // console.log('res的长度: ' + res.length)
    //     // for (let i = 0; i < res.length; i++) {
    //     //     app.innerHTML += `<div>` + res[i].title + `</div>`
    //     // }
    //     return res
    // }).then(res => {
    //     console.log(res)
    // })
    fetch('http://jsonplaceholder.typicode.com/todos', {credentials: 'include'}).then(res => {
        console.log(res)
        return res.json()
    }).then(rodos => {
        console.log(rodos)
    })
</script>

</html>
